package wc.Service.Impl;

import wc.Dao.DaoImpl.UserDaoImpl;
import wc.Dao.UserDao;
import wc.Dao.bean.PageBean;
import wc.Service.UserService;
import wc.domain.User;

import java.sql.SQLException;
import java.util.List;

/**
 * @ClassName:UserServiceImpl
 * @Author: 鹿建文
 * @Date: 2022/4/9  - 16:48
 * @Describe:
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao=new UserDaoImpl();
    @Override
    public PageBean<User> getPage(Integer pageNum, Integer pageSize) throws SQLException {
        int total = userDao.selectCount();
        List<User> users = userDao.selectPage(pageNum, pageSize);
        PageBean<User> pageBean = new PageBean<User>(pageSize,pageNum,total, users);
        return pageBean;
    }
}
